home *** CD-ROM | disk | FTP | other *** search
- /*
- ** Scroll Screen 336
- ** -----------------
- ** This demo allows you to legally scroll up to 50 screens in either
- ** direction by setting the HBUFFER flag. Normally we would blit blocks down
- ** the left and right hand side to give an impression of heaps of screens -
- ** see the MapEditor for this.
- **
- */
-
- MODULE 'dpkernel','gms/dpkernel','graphics/pictures','files/files'
- MODULE 'screens','system/register','system/modules','graphics/screens'
- MODULE 'gms/joydata'
-
- PROC main()
- DEF screen=NIL:PTR TO screen, joy=NIL:PTR TO joydata
- DEF pic=NIL:PTR TO picture, picfile:filename, scrmodule=NIL:PTR TO module
-
- picfile := [ ID_FILENAME, 'GMS:demos/data/PIC.Green']:filename
-
- IF dpkbase := OpenLibrary('GMS:libs/dpkernel.library',0)
- SetUserPrefs(0)
-
- IF (scrmodule := Init([TAGS_MODULE,NIL,
- MODA_NUMBER, MOD_SCREENS,
- MODA_TABLETYPE, JMP_AMIGAE,
- TAGEND], NIL))
-
- scrbase := scrmodule.modbase
-
- IF (screen := Init([TAGS_SCREEN,NIL,
- GSA_SCRWIDTH, 320,
- GSA_SCRHEIGHT, 256,
- GSA_PICWIDTH, 336,
- GSA_PICHEIGHT, 256,
- GSA_PLANES, 5,
- GSA_SCRATTRIB, HSCROLL OR SBUFFER,
- TAGEND],NIL))
-
- IF (pic := Init([TAGS_PICTURE,0,
- PCA_DATA, screen.memptr1,
- PCA_WIDTH, 336,
- PCA_HEIGHT, 256,
- PCA_PLANES, 5,
- PCA_AMTCOLOURS, 32,
- PCA_SCRMODE, screen.scrmode,
- PCA_SCRTYPE, screen.scrtype,
- PCA_FILE, picfile,
- TAGEND],NIL))
-
- screen.palette := pic.palette
- UpdatePalette(screen)
-
- IF (joy := Init(Get(ID_JOYDATA),NIL))
- Display(screen)
- REPEAT
- Query(joy)
- screen.picxoffset := screen.picxoffset + joy.xchange
- MovePicture(screen)
- WaitVBL()
- UNTIL !(joy.buttons AND JD_LMB)
- ENDIF
- ENDIF
- ENDIF
- ENDIF
- Free(joy)
- Free(pic)
- Free(screen)
- Free(scrmodule)
- CloseDPK()
- ENDIF
- ENDPROC
-